<template>
  <div>
    <div class="text-3.5">
      <span>
        认证状态：{{ info.authenticationFlag == 1 ? '已认证' : '未认证' }}
      </span>
      <span class="float-right">认证时间：{{ info.createTime }}</span>
    </div>
    <el-descriptions class="mt-5" title="营业执照信息" class-name="text-center" border :column="2" size="large">
      <el-descriptions-item align="center" label="企业名称">
        {{ info.enterpriseName }}
      </el-descriptions-item>
      <el-descriptions-item align="center" label="统一信用代码">
        {{ info.creditCode }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="企业类型">
        {{ info.businessTermType }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="企业注册所在区域">
        {{ info.provinceName }}/{{ info.cityName }}/{{ info.areaName }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="企业注册地址">
        {{ info.legalAddress }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="企业经营所在区域">
        {{ info.corrProvinceSiteName }}/{{ info.corrCitySiteName }}/{{ info.corrAreaSiteName }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="企业经营地址">
        {{ info.corrAddress }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="经营范围">
        {{ info.businessScope }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="审核状态">
        {{ info.examineResult }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="审核理由">
        {{ info.auditReason }}
      </el-descriptions-item>
    </el-descriptions>


    <el-descriptions class="mt-5" title="法定代表人信息" class-name="text-center" border :column="2" size="large">
      <el-descriptions-item align="center" label="法人名称">
        {{ info.legal.name }}
      </el-descriptions-item>
      <el-descriptions-item align="center" label="法人手机号">
        {{ info.legal.mobile }}
      </el-descriptions-item>
      <el-descriptions-item align="center" label="法人证件号">
        {{ info.legal.idCard }}
      </el-descriptions-item>
      <el-descriptions-item align="center" label="证件有效期">
        {{ info.legal.cardBeginDate }} - {{ info.legal.cardEndDate }}
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="具体有效期">
        {{ info.legal.idCardSpecificValidity }}
      </el-descriptions-item>
      <!-- <el-descriptions-item align="center" :span="2" label="审核状态">
        {{info.legal.auditStatus}}
      </el-descriptions-item> -->
      <!-- <el-descriptions-item align="center" :span="2" label="审核理由">
        100-200万元
      </el-descriptions-item> -->
    </el-descriptions>

    <el-descriptions v-if="info.operator" class="mt-5" title="经办人信息" class-name="text-center" border :column="2"
      size="large">
      <el-descriptions-item align="center" label="姓名">
        {{ info.operator.name }}
      </el-descriptions-item>
      <el-descriptions-item align="center" label="经办人手机号">
        {{ info.operator.phone }}
      </el-descriptions-item>
      <el-descriptions-item align="center" label="经办人证件号">
        {{ info.operator.idCard }}
      </el-descriptions-item>
      <el-descriptions-item align="center" label="证件有效期">
        {{ info.operator.cardBeginDate }} - {{ info.operator.cardEndDate }}
      </el-descriptions-item>
      <!-- <el-descriptions-item align="center" :span="2" label="具体有效期">
        100-200万元
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="审核状态">
        100-200万元
      </el-descriptions-item>
      <el-descriptions-item align="center" :span="2" label="审核理由">
        100-200万元
      </el-descriptions-item> -->
    </el-descriptions>
  </div>
</template>
<script setup lang="ts">
const route = useRoute()
import { getEnterpriseInfo } from '@/api/enterprise';
const info = reactive({
  legal: {
    name: '',
    phone: '',
    idCard: '',
    cardBeginDate: '',
    cardEndDate: '',
    idCardSpecificValidity: ''
  },
  operator: {
    name: '',
    phone: '',
    idCard: '',
    cardBeginDate: '',
    cardEndDate: '',
    idCardSpecificValidity: ''
  },
})

onMounted(() => {
  getEnterpriseInfo(route.query.id).then(res => {
    Object.assign(info, res.data)
  })
})
</script>

<style lang="scss" scoped>
:deep(.el-descriptions__title) {
  font-weight: normal;
}
</style>
